﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Assignment3
{
    class ReadFile
    {
        /// <summary>
        /// Static method to read file and return List of strings
        /// </summary>
        /// <param name="fileName">Input File Name</param>
        /// <returns>List of string. Each string represents one line.</returns>
        public static List<string> Read(string fileName)
        {
            List<string> input = new List<string>();
            using (System.IO.StreamReader reader = new System.IO.StreamReader(new FileStream(fileName, FileMode.Open, FileAccess.Read)))
            {
                while (!reader.EndOfStream)
                {
                    string currentLine = reader.ReadLine();
                    if (currentLine != "")
                    {
                        input.Add(currentLine);
                    }
                }
            }
            return input;
        }
    }
}
